/*
*********************************************************************************************************
*                                   STM32F4 Driver Platform
*
*                             (c) Copyright 2015; ���˿Ƽ���չ���޹�˾
*
*                   All rights reserved.  Protected by international copyright laws.
*                   Knowledge of the source code may not be used to write a similar
*                   product.  This file may only be used in accordance with a license
*                   and should not be redistributed in any way.
*********************************************************************************************************
*/

/*
*********************************************************************************************************
*
*                                        the Application of ETH TASK
*                             ST Microelectronics STM32 with the STM32F407IGT6
*
* Filename      : app_ETH.h
* Version       : V1.0.0
* Programmer(s) : ZhangYu(����@Like)
*********************************************************************************************************
*/
#ifndef __APP_ETh_H__
#define __APP_ETh_H__

#define	LINK_CHECK_PERIOD		20

#define UDP_CLIENT_EN			(1)		/*0-> do not enable client to debug 1-> enable client to debug*/

#define UDP_CAPTURE_EN			(1)		/*0-> do not enable Eth capture 1-> enable Eth capture*/

//TRDP Message block
typedef struct ETH_MSG {
	uint32_t	id;						//TRDP's communication id
	uint32_t	len;					//TRDP's data length
	uint8_t		data[1460];				//TRDP's data content
}ETH_MSG;

//PC and Device communication package body
typedef struct OPP_FRM_HEAD{
	uint32_t	dataLen;
	uint8_t		cmd;				//package command
	uint8_t		ctrlState;			//data contents description example: how many SD sectors in this package
	uint16_t	oppCode;			//package number id
}OPP_FRM_HEAD;

extern uint8_t	link4GTryCnt;
//------------------public function declare---------------
void TASK_ETH( void *pvParameters );
void ETH_ChangeAppConfig(void);
#if UDP_CLIENT_EN
uint32_t TRDP_Send_Main_Message(uint8_t *data, uint16_t size, int idx);
void TRDP_Update_MultiCast(void);
#endif

#endif /* __MINIMAL_ECHO_H */
